<template>
    <Spin size="large" fix v-if="loading" class="demo-spin">
        <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
        <div>
            {{ title ? title : '  数据加载中...' }}
        </div>
    </Spin>
</template>
<script>
export default {
    components: {},
    props: ['show', 'title'],
    watch: {
        show: {
            handler(newV) {
                this.loading = newV
            }
        }
    },
    data() {
        return {
            loading: false
        }
    },
    mounted() {}
}
</script>
<style lang="scss" scoped>
.demo-spin {
    background-color: rgba(0, 0, 0, 0.2);
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.demo-spin-icon-load {
    animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
    from {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
    to {
        transform: rotate(360deg);
    }
}
</style>
